home *** CD-ROM | disk | FTP | other *** search
/ Programming Languages Suite / ProgLangD.iso / TURBOPASCAL WIN / DOC.PAK / TEMC.DOC < prev    next >
Text File  |  1992-06-08  |  31KB  |  705 lines

  1. ===========================================================================
  2. ===========================================================================
  3.  
  4.                              TEMC.DOC
  5.  
  6. ===========================================================================
  7. Turbo Editor macros
  8. ===========================================================================
  9.  
  10.           TEMC.EXE is an editor macro compiler for the IDE. It
  11.           processes a script file that defines editor macros and
  12.           key bindings, and produces a configuration file that is
  13.           read by the IDE to define the effects of keyboard
  14.           commands in the editor.
  15.  
  16.           The file TPWALT.TEM contains the default macro
  17.           definitions and key bindings built into the IDE editor.
  18.           It serves as an example script, as well as a base from
  19.           which to customize the editor.
  20.  
  21. ===========================================================================
  22. TEMC command line
  23. ===========================================================================
  24.  
  25.           TEMC is invoked from the DOS command line. Type
  26.  
  27.               temc [-c] <script file> <config file>
  28.  
  29.           The script file extension is .TEM if not specified
  30.           otherwise. The configuration file extensions is assumed
  31.           to be .CMD.
  32.  
  33.           The configuration file need not exist. If it does not
  34.           exist, it is created. The optional -c switch can also
  35.           be specified as /c, and can appear in any argument
  36.           position on the command line. If you use this option,
  37.           any existing command table in your configuration file
  38.           is thrown away before TEMC processes the script file.
  39.           When -c is not used, the key bindings in the script
  40.           file are merged with those already defined in the
  41.           configuration file.
  42.  
  43.           TEMC modifies the commands used by the IDE when the
  44.           Alternate command set is specified in Options|
  45.           Preferences.
  46.  
  47.           You can use TPWALT.TEM to re-create exactly the
  48.           default settings of the Alternate command set. This
  49.           file is included as both a sample script file and as
  50.           the default command table. You can copy it and modify
  51.           it for your own use.
  52.  
  53. ===========================================================================
  54. Syntax
  55. ===========================================================================
  56.  
  57.           The syntax to define a macro is
  58.  
  59.               MACRO <macroname>
  60.                 <command1>;
  61.                 [ <command2>; ... ]
  62.               END;
  63.  
  64.           <macroname> can consist of anything that is a legal C
  65.           symbol, and <command> can be either the name of another
  66.           predefined macro or a predefined TEMC editor command. A
  67.           list of editor commands and what they do follows.
  68.  
  69.           When you define your macro, the following points are
  70.           valid:
  71.  
  72.           1. A statement defines either a named macro or a key
  73.              binding.
  74.  
  75.           2. Spaces and new lines are optional.
  76.  
  77.           3. Comments are in C-style /* ... */ pairs.
  78.  
  79.           4. Unlike C, TEMC's language is case insensitive.
  80.  
  81.           5. Some of the predefined editor commands have a syntax
  82.              that looks like a C function call with one argument.
  83.              For example,
  84.  
  85.                  SetMark(5);
  86.  
  87.              Depending on the command, the argumment is either a
  88.              decimal integer constant, a character constant, or a
  89.              string literal. All are specified using C syntax.
  90.  
  91.           Here's an example of a macro definition from
  92.           TPWALT.TEM:
  93.  
  94.               MACRO MacScrollUp
  95.                 ScrollScreenUp; FixCursorPos;
  96.               END;
  97.  
  98.           The syntax to define a key binding is
  99.  
  100.               <key-sequence>: <command>;
  101.  
  102.              or
  103.  
  104.               <key-sequence>: BEGIN <command1>; [ <command2>; ... ]
  105.               END;
  106.  
  107.           The <key-sequence> is either a key (a character
  108.           optionally preceded by Ctrl or Alt), or a series of
  109.           keys separated by a plus sign (+). Note that the
  110.           specification of the key characters themselves is case
  111.           sensitive. For example, Ctrl-k+B is different than
  112.           Ctrl-k+b, even though the latter is the same as CTRL-K+b.
  113.  
  114.           Whitespace is allowed between the key-sequence and the
  115.           colon, and each <command> can be either the name of a
  116.           previously defined macro, or one of the predefined
  117.           editor commands listed in Table 1.1.
  118.  
  119. ===========================================================================
  120. Key codes
  121. ===========================================================================
  122.  
  123.           The IDE editor makes use of an extended character set
  124.           that includes key combinations not normally available
  125.           to DOS programs. Key codes can be specified in a script
  126.           through any combination of the symbols "Ctrl-", "Shift-",
  127.           "Alt-" and a character.
  128.  
  129.           Some keys cannot be entered directly into a TEMC
  130.           script. Those keys can be referred to by their names,
  131.           as described in the following table.
  132.  
  133.           Any key in a sequence--except the first key--can be
  134.           preceded by one of the characters ^ or @. The caret (^)
  135.           indicates that any combination of case and "Ctrl" can
  136.           be used to type the key; that is, lowercase, uppercase,
  137.           or control characters. The @ sign is used to indicate
  138.           that case is insignificant for the following character,
  139.           although "Ctrl" is not accepted. For example,
  140.  
  141.           * Ctrl-k+b specifies a Ctrl-K followed by a lowercase b.
  142.  
  143.           * Ctrl-k+^b specifies a Ctrl-K followed by any of b, B,
  144.             or Ctrl-B.
  145.  
  146.           * Ctrl-k+@B specifies Ctrl-K followed by either b or B.
  147.  
  148.      Named keys
  149.  
  150.           Key are specified as letters, numbers, or characters,
  151.           optionally preceded by one or more of Ctrl-, Alt- or
  152.           Shift-. The following names specify keys that cannot be
  153.           typed as themselves in the TEMC syntax.
  154.  
  155.           -------------------------------------------------------
  156.              Key name    Notes
  157.           -------------------------------------------------------
  158.              Home
  159.              End
  160.              PgUp
  161.              PgDn
  162.              LfAr        Left arrow
  163.              RgAr        Right arrow
  164.              UpAr        Up arrow
  165.              DnAr        Down arrow
  166.              Ins
  167.              Del
  168.              Enter
  169.              Return      Same as Enter
  170.              BkSp        Backspace
  171.              Tab
  172.              BkTab       No longer available, use Shift-Tab
  173.              Esc
  174.              Star        * key on the numeric keypad
  175.              Minus       - key on the numeric keypad
  176.              Plus        + key on the numeric keypad
  177.              Space       Spacebar
  178.              PrtSc
  179.              F1 to F10   Function keys
  180.  
  181. ===========================================================================
  182. Predefined editor commands
  183. ===========================================================================
  184.  
  185.           TEMC lets you use built-in editor commands and user-
  186.           defined macros as commands within macros
  187.           interchangeably, as long as you don't create any loops
  188.           by having two macros calling each other, even via
  189.           intermediate macros. Note that some commands cause an
  190.           escape from the editor to the surrounding IDE, for
  191.           example, by bringing up a dialog box. Your macro will
  192.           "pause" until control returns to the editor.
  193.  
  194.           A list of all predefined TEMC editor commands is shown
  195.           next. Commands that cause an escape from the editor
  196.           follow.
  197.  
  198.      TEMC editor commands
  199.  
  200.           -------------------------------------------------------
  201.           Command name                What the editor does
  202.           -------------------------------------------------------
  203.  
  204.           BackspaceDelete             Deletes character before
  205.                                       the cursor.
  206.  
  207.           BottomOfScreen              Moves cursor to the bottom
  208.                                       line of the current window,
  209.                                       leaving column unchanged.
  210.  
  211.           CenterFixScreenPos          Adjusts the screen display
  212.                                       to ensure the cursor is
  213.                                       visible. If any adjustment
  214.                                       is necessary, adjust the
  215.                                       display so the cursor is
  216.                                       close to being centered in
  217.                                       the window.
  218.  
  219.           CopyBlock                   If there is a valid and
  220.                                       highlighted (selected)
  221.                                       text block, then at the
  222.                                       cursor location, inserts a
  223.                                       copy of the characters that
  224.                                       are selected and makes that
  225.                                       the new selected text
  226.                                       location.
  227.  
  228.           CursorCharLeft              Moves cursor left over one
  229.                                       character. This command
  230.                                       will skip over tab
  231.                                       characters and move to the
  232.                                       end of the previous line.
  233.  
  234.           CursorCharRight             Moves cursor right over one
  235.                                       character. This  command
  236.                                       will skip over tab
  237.                                       characters and advance to
  238.                                       the beginning of the next
  239.                                       line.
  240.  
  241.           CursorDown                  Moves cursor down one row.
  242.  
  243.           CursorLeft                  Moves cursor left one
  244.                                       screen column.
  245.  
  246.           CursorRight                 Moves cursor right one
  247.                                       screen column.
  248.  
  249.           CursorSwitchedLeft          Like CursorLeft, but pays
  250.                                       attention to cursor through
  251.                                       tab option setting (see
  252.                                       SetCursorThroughTabMode).
  253.  
  254.           CursorSwitchedRight         Like CursorRight, but pays
  255.                                       attention to cursor
  256.                                       through tab option setting
  257.                                       (see SetCursorThroughTabMode).
  258.  
  259.           CursorUp                    Moves cursor up one row.
  260.  
  261.           DeleteBlock                 If there is a valid and
  262.                                       highlighted (selected) text
  263.                                       block, deletes the
  264.                                       characters that are in it.
  265.  
  266.           DeleteChar                  Deletes the character at
  267.                                       the current cursor
  268.                                       location.
  269.  
  270.           DeleteLine                  Deletes the current line.
  271.  
  272.           DeleteToEOL                 Deletes all characters in
  273.                                       the current line, leaving a
  274.                                       zero-length line.
  275.  
  276.           DeleteWord                  Deletes from cursor to
  277.                                       beginning of next word.
  278.  
  279.           EndCursor                   Moves cursor to end of file
  280.                                       buffer.
  281.  
  282.           ExtendBlockBeg              Initiates a series of
  283.                                       commands that will select a
  284.                                       block of text between the
  285.                                       initial and ending
  286.                                       positions of the cursor.
  287.  
  288.           ExtendBlockEnd              Ends a series of commands
  289.                                       begun by ExtendBlockBeg.
  290.  
  291.           FixCursorPos                Ensures that the cursor
  292.                                       value specifies a row
  293.                                       between 1 and the number of
  294.                                       lines in the buffer, a
  295.                                       column greater than 0. If
  296.                                       the cursor through tab
  297.                                       option is not set, the
  298.                                       cursor is not placed in the
  299.                                       middle of a tab character
  300.                                       (see SetCursorThroughTabMode).
  301.  
  302.           FixScreenPos                Adjusts the screen display
  303.                                       to ensure the cursor is
  304.                                       visible.
  305.  
  306.           FullPaintScreen             Redraws the entire window,
  307.                                       making no assumptions about
  308.                                       what is onscreen.
  309.  
  310.           HideBlock                   Sets a flag indicating that
  311.                                       the selected text should
  312.                                       not be highlighted.
  313.  
  314.           HighlightBlock              Sets a flag indicating that
  315.                                       if the beginning and end
  316.                                       selected text markers are
  317.                                       valid, the selected text
  318.                                       should be highlighted.
  319.  
  320.           HomeCursor                  Moves cursor to beginning
  321.                                       of the file buffer.
  322.  
  323.           IndentBlock                 Inserts a space at the
  324.                                       beginning of each line in
  325.                                       the highlighted (selected)
  326.                                       text.
  327.  
  328.           InsertText                  Inserts the literal
  329.                                       "string" in the buffer at
  330.                                       the current cursor
  331.                                       location. Use the syntax
  332.                                       InsertText(string) to call
  333.                                       this command.
  334.  
  335.           LeftOfLine                  Moves cursor to beginning
  336.                                       of the current line.
  337.  
  338.           LiteralChar                 Inserts the character at
  339.                                       the current cursor
  340.                                       location, without doing any
  341.                                       special processing for
  342.                                       newline, tab characters,
  343.                                       etc. Use the syntax
  344.                                       LiteralChar(c), where c is
  345.                                       a character or integer
  346.                                       value.
  347.  
  348.           MarkBufModified             Sets a flag indicating that
  349.                                       the contents of the buffer
  350.                                       are different than what is
  351.                                       in the corresponding disk
  352.                                       file.
  353.  
  354.           MarkBufUnModified           Clears a flag, thus
  355.                                       indicating that the
  356.                                       contents of the buffer can
  357.                                       be assumed to be identical
  358.                                       to what is in the disk
  359.                                       file.
  360.  
  361.           MatchPairBackward           Same as MatchPairForward
  362.                                       except if the cursor is on
  363.                                       a ' or ", searches backward
  364.                                       for the matching character.
  365.  
  366.           MatchPairForward            If the cursor is on one of
  367.                                       the characters (, ), {, },
  368.                                       [, ], or on the first
  369.                                       character of one of the
  370.                                       pairs /* or */, searches in
  371.                                       the appropriate direction
  372.                                       for the closest instance of
  373.                                       the matching delimiter. If
  374.                                       the cursor is on the
  375.                                       character ' or ", searches
  376.                                       forward for the matching
  377.                                       character. If a match is
  378.                                       found, places the cursor
  379.                                       there.
  380.  
  381.           MoveBlock                   Like CopyBlock, but also
  382.                                       deletes the original
  383.                                       selected text.
  384.  
  385.           MoveToBlockBeg              Moves cursor to the
  386.                                       location marked as the
  387.                                       beginning of the selected
  388.                                       text.
  389.  
  390.           MoveToBlockEnd              Moves cursor to the
  391.                                       location marked as the end
  392.                                       of the selected text.
  393.  
  394.           MoveToMark                  Moves the cursor to the
  395.                                       location saved with
  396.                                       SetMark(n) command. Use the
  397.                                       syntax MoveToMark(n), where
  398.                                       n is a one-digit number, 0-9.
  399.  
  400.           MoveToPrevPos               Moves the cursor to the
  401.                                       location specified by the
  402.                                       "previous position marker."
  403.  
  404.           MoveToTempPos               Moves the cursor to the
  405.                                       saved temporary marker.
  406.  
  407.           NullCmd                     No operation. Calls the
  408.                                       editor, but performs no
  409.                                       function. Can be used to
  410.                                       cause a keystroke to have
  411.                                       no effect.
  412.  
  413.           OutdentBlock                Deletes a leading space, if
  414.                                       any, from the beginning of
  415.                                       each line in the
  416.                                       highlighted (selected)
  417.                                       text.
  418.  
  419.           PageDown                    Moves cursor down by number
  420.                                       of lines in the window.
  421.  
  422.           PageScreenDown              Scrolls screen down by
  423.                                       numer of lines in the
  424.                                       window, leaving cursor
  425.                                       position unchanged.
  426.  
  427.           PageScreenUp                Scrolls screen up by numer
  428.                                       of lines in the window,
  429.                                       leaving cursor position
  430.                                       unchanged.
  431.  
  432.           PageUp                      Moves cursor up by number
  433.                                       of lines in the window.
  434.  
  435.           PaintScreen                 Redraws the entire window,
  436.                                       assuming that the screen
  437.                                       still correctly displays
  438.                                       what the editor last drew
  439.                                       on it.
  440.  
  441.           ReDo                        Performs an Redo operation.
  442.                                       Exactly what happens
  443.                                       depends on the option
  444.                                       settings.
  445.  
  446.           RightOfLine                 Moves cursor to end of
  447.                                       current line.
  448.  
  449.           RightOfWord                 Moves cursor to the next
  450.                                       column that follows the end
  451.                                       of a word.
  452.  
  453.           ScrollScreenDown            Scrolls screen down one
  454.                                       line, leaving cursor
  455.                                       position unchanged.
  456.  
  457.           ScrollScreenUp              Scrolls screen up one line,
  458.                                       leaving cursor position
  459.                                       unchanged.
  460.  
  461.           SetAutoIndent               Sets the Auto Indent option
  462.                                       On.
  463.  
  464.           SetAutoOutdent              Sets the Backspace
  465.                                       Unindents option On.
  466.  
  467.           SetBlockBeg                 Sets the beginning of the
  468.                                       selected text to be the
  469.                                       character at the current
  470.                                       cursor location.
  471.  
  472.           SetBlockEnd                 Sets the end of the
  473.                                       selected text to be the
  474.                                       character at the current
  475.                                       cursor location.
  476.  
  477.           SetCursorThroughTabMode     Sets the Cursor Through
  478.                                       Tabs option On.
  479.  
  480.           SetInsertMode               Sets Insert/Overwrite
  481.                                       option to Insert.
  482.  
  483.           SetMark                     Sets a marker to point to
  484.                                       the character at the
  485.                                       current cursor location, so
  486.                                       a later MoveToMark(n)
  487.                                       comand can restore the
  488.                                       cursor. Use the syntax
  489.                                       SetMark(n), where n is a
  490.                                       one digit number, 0-9.
  491.  
  492.           SetOptimalFillMode          Sets Optimal Fill option On.
  493.  
  494.           SetPrevPos                  Sets a marker (the previous
  495.                                       position marker) to point
  496.                                       to the character at the
  497.                                       current cursor location.
  498.                                       This marker location
  499.                                       changes only by a call to
  500.                                       SetPrevPos or SwapPrevPos.
  501.  
  502.           SetTabbingMode              Sets Use Tab Char option On.
  503.  
  504.           SetTempPos                  Saves the cursor location
  505.                                       in a temporary marker that
  506.                                       can be used by some
  507.                                       internal editor commands.
  508.                                       This is not a practical
  509.                                       application in user-defined
  510.                                       macros. Use SetMark instead.
  511.  
  512.           SmartRefreshScreen          Redraws the window,
  513.                                       skipping any portions that
  514.                                       the editor is sure are
  515.                                       unmodified since the last
  516.                                       redraw.
  517.  
  518.           SmartTab                    Inserts space or tab
  519.                                       characters in accordance
  520.                                       with the current settings
  521.                                       of the Use Tab Char option,
  522.                                       Tab Width.
  523.  
  524.           SwapPrevPos                 Exchanges the values of the
  525.                                       cursor and the "previous
  526.                                       position marker."
  527.  
  528.           ToggleAutoIndent            Toggles the state of the
  529.                                       Auto Indent option.
  530.  
  531.           ToggleAutoOutdent           Toggles the state of the
  532.                                       Backspace Unindents option.
  533.  
  534.           ToggleCursorThroughTabMode  Toggles the state of the
  535.                                       Cursor Through Tabs option.
  536.  
  537.           ToggleHideBlock             Toggles the state of the
  538.                                       highlight (selected) text
  539.                                       flag (see HighlightBlock).
  540.  
  541.           ToggleInsert                Toggles state of
  542.                                       Insert/Overwrite option.
  543.  
  544.           ToggleOptimalFillMode       Toggles state of Optimal
  545.                                       Fill option.
  546.  
  547.           ToggleTabbingMode           Toggles state of Use Tab
  548.                                       Char option.
  549.  
  550.           TopOfScreen                 Moves cursor to the top
  551.                                       line currently displayed in
  552.                                       the window, leaving column
  553.                                       unchanged.
  554.  
  555.           UnDo                        Performs an Undo operation.
  556.                                       Exactly what happens
  557.                                       depends on the option
  558.                                       settings.
  559.  
  560.           WordLeft                    Moves cursor to beginning
  561.                                       of previous word, or to end
  562.                                       of previous line, whichever
  563.                                       is first.
  564.  
  565.           WordRight                   Moves cursor to beginning
  566.                                       of next word, or to the end
  567.                                       of a line, whichever is
  568.                                       first.
  569.  
  570.           -------------------------------------------------------
  571.  
  572.           The following commands cause an exit from the editor,
  573.           for example, by bringing up a dialog box. The macro
  574.           resumes when the editor window regains the focus.
  575.  
  576.           The keys listed next to some of the commands below are
  577.           the ones used by default when the Alternate mode of the
  578.           IDE is selected.
  579.  
  580.           -------------------------------------------------------
  581.  
  582.           ChangeDirectory     Opens a dialog box for changing the
  583.                               current directory.
  584.  
  585.           ChangeModeFlags     Used after a command such as
  586.                               ToggleInsert which changes the
  587.                               state of an editor option switch.
  588.                               Causes the IDE to update various
  589.                               menu items and/or icons.
  590.  
  591.           ClipCopy            Copys selected text to Clipboard
  592.                               (Ctrl-Ins).
  593.  
  594.           ClipCut             Cuts selected text to Clipboard
  595.                               (Shift-Del).
  596.  
  597.           ClipPaste           Pastes Clipboard into buffer at
  598.                               cursor (Shift-Ins).
  599.  
  600.           ClipShow            Shows Clipboard (no hot key
  601.                               defined).
  602.  
  603.           CloseWindow         Closes editor window (Alt-F3).
  604.  
  605.           CompileFile         Compiles current buffer (Alt-F9).
  606.  
  607.           CompileMenu         Selects Compile menu (Alt-C).
  608.  
  609.           CompilerOptions     Inserts compiler options string
  610.                               at the top of file (Ctrl-O+O).
  611.  
  612.           EditMenu            Selects Edit menu (Alt-E).
  613.  
  614.           FileMenu            Selects File menu (Alt-F).
  615.  
  616.           GetFindString       Opens a dialog box for the Search
  617.                               operation. (Alt-S+F)
  618.  
  619.           GotoWindow1         Selects window #1 (Alt-1).
  620.  
  621.           GotoWindow2         Selects window #2 (Alt-2).
  622.  
  623.           GotoWindow3         Selects window #3 (Alt-3).
  624.  
  625.           GotoWindow4         Selects window #4 (Alt-4).
  626.  
  627.           GotoWindow5         Selects window #5 (Alt-5).
  628.  
  629.           GotoWindow6         Selects window #6 (Alt-6).
  630.  
  631.           GotoWindow7         Selects window #7 (Alt-7).
  632.  
  633.           GotoWindow8         Selects window #8 (Alt-8).
  634.  
  635.           GotoWindow9         Selects window #9 (Alt-9).
  636.  
  637.           Help                Opens the Help window (F1).
  638.  
  639.           HelpMenu            Selects Help menu (Alt-H).
  640.  
  641.           HelpIndex           Display the Help system't index
  642.                               (Shift-F1).
  643.  
  644.           LastHelp            Opens previous help window (Alt-F1).
  645.  
  646.           MakeProject         Makes project (F9).
  647.  
  648.           Menu                Highlights top menu bar.
  649.  
  650.           Modify              Evaluates expression/modify
  651.                               variable (Ctrl-F4).
  652.  
  653.           NextWindow          Selects next window in IDE (F6).
  654.  
  655.           OpenFile            Opens dialog box for File Open (F3).
  656.  
  657.           OptionsMenu         Selects Options menu (Alt-O).
  658.  
  659.           PrintBlock          Writes selected text to the
  660.                               printer.
  661.  
  662.           Quit                Exits the IDE (Alt-X).
  663.  
  664.           ReadBlock           Opens dialog box requesting a file
  665.                               name to be read into the buffer at
  666.                               the cursor location and marked as
  667.                               selected text.
  668.  
  669.           RepeatSearch        Searches again, using previous
  670.                               parameters.
  671.  
  672.           Replace             Opens an dialog box for the Replace
  673.                               operation.
  674.  
  675.           RunMenu             Selects Run menu (Alt-R).
  676.  
  677.           RunProgram          Makes and runs current executable
  678.                               (Ctrl-F9).
  679.  
  680.           SaveFile            Saves current editor buffer (F2).
  681.  
  682.           SaveFileAs          Opens dialog for File SaveAs.
  683.  
  684.           SearchMenu          Selects Search menu (Alt-S).
  685.  
  686.           SystemMenu          Selects Sytem menu (Alt-Spacebar).
  687.  
  688.           WindowList          Displays window list (Alt-0).
  689.  
  690.           WindowMenu          Selects Window menu (Alt-W).
  691.  
  692.           WindowCascade       Cascades windows (Shift-F4).
  693.  
  694.           WindowTile          Tiles windows (Shift-F5).
  695.  
  696.           WordHelp            Context sensitive help (Ctrl-F1).
  697.  
  698.           WriteBlock          Opens dialog box requesting a file
  699.                               name to which the selected text
  700.                               will be written.
  701.  
  702.           ZoomWindow          Zooms/unzoomd current window (F5).
  703.  
  704. ===========================================================================
  705. ===========================================================================